import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: wangj
 * Date: 2022-02-18
 * Time: 8:46
 */
public class TestDemo {
    public static int fac(int n){
        int ret=1;
        for (int i = 1; i <= n; i++) {
            ret*=i;
        }
        return ret;
    }
    public static int facAdd(int n){
        int ret=1;
        for (int i = 1; i <= n; i++) {
            ret+=fac(i);
        }
        return ret;
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int ret=facAdd(n);
        System.out.println(ret);
    }
}
